package com.jsgt.greekfire.repository

import okhttp3.MediaType
import okhttp3.RequestBody
import org.json.JSONObject

/**
 * author fhx
 * create time 2020/4/25 15:45
 **/
abstract class BaseRepository {
    protected fun parseBody(params: Map<String, Any>): RequestBody {
        val json = JSONObject(params)
        return RequestBody.create(MediaType.get("application/json; charset=UTF-8"),json.toString())
    }
}